﻿
@{
    Layout = null;
}
<html>
<head>
    <meta http-equiv="Content-Language" content="zh-cn" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta name="author" content="Fhua" />
    <meta name="Copyright" content="BLIT" />
    <meta name="viewport" content="width=device-width, maximum-scale=1.0, initial-scale=1.0,initial-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <title>Login</title>
    <link href="~/lib/layui/css/layui.css" rel="stylesheet" />
    <link href="~/css/global.css" rel="stylesheet" />
    <link href="~/content/fhuaui/css/login.css" rel="stylesheet" />
</head>
<body>
    <div class="layui-header header login-header">
        <div class="layui-main login-top-bg">
            <div class="sitename">
                <h2>RMM管理系统</h2>
            </div>
        </div>
    </div>
    <div class="login_content">
        <div id="regist">
            <div id="login-banner">
                <a href="#" target="_blank">
                    <img src="~/content/fhuaui/img/mhdcity.jpg">
                </a>
            </div>
            <div id="login">
                <form action="" class="layui-form layui-form-pane" id="sign-in" method="post" role="form">
                    <input id="bsinfo" name="bsinfo" type="hidden" />
                    <p>
                        <div class="layui-form-item">
                            <label class="layui-form-label">账号</label>
                            <div class="layui-input-block">
                                <input v-model="name" name="user_name" lay-verify="required" autocomplete="off" placeholder="请输入账号" class="layui-input" type="text">
                            </div>
                        </div>
                    </p>
                    <p>
                        <div class="layui-form-item">
                            <label class="layui-form-label">密码</label>
                            <div class="layui-input-block">
                                <input v-model="pwd" name="password" lay-verify="required" autocomplete="off" placeholder="请输入密码" class="layui-input" type="password">
                            </div>
                        </div>
                    </p>
                    <p class="submit">
                        <div class="layui-form-item">
                            <a v-on:click="login" class="layui-btn btn_show" id="btn_submit" lay-submit="" data-loading-text="登录中..." lay-filter="btnsubmit">登　录</a>
                        </div>
                    </p>
                    <p id="nav">
                        忘记密码 or 没有账号？请联系管理修改。
                    </p>
                </form>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="layui-footer footer footer-doc">

    </div>
    <script src="~/Scripts/jquery-2.1.4.min.js"></script>
    <script src="~/lib/layui/layui.js"></script>
    <script src="~/lib/vuejs/vue.js"></script>
    <script src="~/lib/vuejs/vue_extensions.js"></script>
    <script type="text/javascript">
        var vue = new vueAccountTable({
            el: '#login',
            data: function () {
                return {
                    name: '',
                    pwd: ''
                }
            },
            methods: {
                login() {
                    if (this.name == '') {
                        layer.msg("用户名不能为空");
                        return;
                    }
                    if (this.pwd == '') {
                        layer.msg("密码不能为空");
                        return;
                    }

                    this.postAsync('/login/LoginAdmin', { id: this.name, pwd: this.pwd }, function (msg) {
                        if (msg.code != 0) {
                            layer.msg(msg.msg);
                        } else {
                            window.location.href = "/";
                        }
                    })
                }
            }
        });
    </script>
</body>
</html>
